﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestGame
{
    public class MapProto
    {
        //a class to hold all of the data about a map, but not actually creating any of it
        public string Map { get; private set; }
        public string author { get; private set; }
        public string title { get; private set; }
        public int height { get; private set; }
        public int width { get; private set; }

        public MapProto(string breakMe)
        {
            string[] categories = breakMe.Split(';');
            foreach(string s in categories){
                string[] components = s.Split(':');
                switch (components[0].Trim())
                {
                    case "name":
                        title = components[1];
                        break;
                    case "height":
                        height = Convert.ToInt32(components[1]);
                        break;
                    case "width":
                        width = Convert.ToInt32(components[1]);
                        break;
                    case "author":
                        author = components[1];
                        break;
                    case "map":
                        Map = components[1];
                        break;
                }
            }

        }
    }
}
